JavaScript內建函式


Posted by oack7426 on 2020-06-30

tips:
此處筆記寫得很簡略,詳細請看官網的常用函式介紹

數字相關

Number({內容})
parseInt({內容},{幾進位}) 整數(預設10進位)
parseFloat({內容}) 浮點數

{變數} +'' 數字變字串

參考資料

Number

數字運算

Math
Math.cell({內容}) 無條件進位
Math.floor({內容}) 無條件捨去
Math.round({內容}) 四捨五入
Math.random() 產生 0 ~ 0.99999 的亂數

參考資料

Math

String

字串也能比大小 (a-z / A-Z)
indexOf({內容})找字串
split()切字串

參考資料

String

Array

join()
map
filter() 過濾
slice

參考資料

Array


#javascrit







Related Posts

AWS Solutions Architect - Associate (SAA) 學習計畫與備考心得: Module 2

AWS Solutions Architect - Associate (SAA) 學習計畫與備考心得: Module 2

[心得] 滑鼠們2 - Logitech

[心得] 滑鼠們2 - Logitech

使用 Python 進行中斷點 step by step debug 除錯

使用 Python 進行中斷點 step by step debug 除錯


Comments